$(function(){
    addAllFullscreenIconListener();
});
function addAllFullscreenIconListener(){
    var allChartsDom = document.getElementsByClassName("charts-container"); 
    
    for (var i = 0; i < allChartsDom.length; i++) {

        var div = $(allChartsDom[i]);
        div.find(".fa-arrows-alt").click(function () {
            var fullIcon = this;
            var div = $(fullIcon).parents(".charts-container");
            debugger
            if(div.hasClass("full-charts")){
                div.removeClass("full-charts");
                $(".layui-header").show();
                $(".layui-side").show();
                // $(".layui-body").css("overflow","");
                var chatsDom =  div.find(".charts-inner-container")[0];
                $(chatsDom).removeClass("charts-inner-container-fullheight");
                var charts = echarts.getInstanceByDom(chatsDom);
                if(charts){
                    charts.resize();
                }
            }else{
                div.addClass("full-charts");
                $(".layui-header").hide();
                $(".layui-side").hide();
                // $(".layui-body").css("overflow","hidden");
                var chatsDom =  div.find(".charts-inner-container")[0];
                $(chatsDom).addClass("charts-inner-container-fullheight");
                var charts = echarts.getInstanceByDom(chatsDom);
                if(charts){
                    charts.resize();
                }
            }
        });
    }

}